import { DraftContent } from '../models/DraftContent';

export function saveDraft(content: DraftContent, path: string): void {
  const json = JSON.stringify(content, null, 2);
  require('fs').writeFileSync(path, json);
}

export function loadDraft(path: string): DraftContent {
  const json = require('fs').readFileSync(path, 'utf-8');
  return JSON.parse(json);
}
